<!doctype html>
<html>
<head>
    <title>{$INI['system']['sitename']}</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link rel="stylesheet" href="/css/style.css">
    <link rel="stylesheet" href="/css/font-awesome.min-4.3.0.css">
	<script src="/js/jsAddress.js" type="text/javascript"></script>
	<script src="/js/jquery.min-2.1.3.js" type="text/javascript"></script>

</head>
			  
<body>
<div class="mod_container">
        <div class="wx_bar">
            <div class="wx_bar_back">
                <a id="back" href="javascript:void(0);"></a>
            </div>
            <div class="wx_bar_tit">收货地址</div>
        </div>
        <div class="wx_wrap">
			<form action="/account/setaddress.php" method="post" class="validator">
            <div class="address_new">
                <input id="address_regionId" value="" type="hidden">
                <input id="adid" value="" type="hidden">
					
                <p>
                    <label for="name"><span class="tit">收货人</span>
                        <input id="name" name="realname" value="{$address_info['name']}" placeholder="名字" type="text">
                        <span id="updateTip1" style="color: red; display: none;">请填写姓名</span>
                    </label>
                </p>
                <p>
                    <label for="mobile"><span class="tit">手机号码</span>
                        <input id="mobile" name="mobile" value="{$address_info['mobile']}" placeholder="手机号码" type="tel">
                        <span id="updateTip2" style="color: red; display: none;">请填写正确的手机号</span>
                    </label>
                </p>
                <p>
                    <label for="provinceId"><span class="tit">省份</span>
                        <select id="s_province" name="provinceId">
                        </select>
                        <span id="updateTip3" style="color: red; display: none;">请选择省</span>
                    </label>
                </p>
                <p>
                    <label for="cityId"><span class="tit">市</span>
                        <select name="cityId" id="s_city">
                        </select>
                        <span id="updateTip4" style="color: red; display: none;">请选择市</span>
                    </label>
                </p>
                <p id="areaSelP">
                    <label for="areaId"><span class="tit">区/县</span>
                        <select name="areaId" id="s_county" placeholder="111">
                        </select>
                        <span id="updateTip5" style="color: red; display: none;">请选择区/县</span></label>
                </p>
                <p>
                    <label for="adinfo"><span class="tit">详细地址</span>
                        <input id="adinfo" name="adinfo" value="{$address_info['street']}" placeholder="详细地址" type="text">
                        <span id="updateTip6" style="color: red; display: none;">请填写详细地址</span>
                    </label>
                </p>
				<input type="hidden" name="refurl" value="{$refurl}" />
				<input type="hidden" name="id" value="{$address_info['id']}" />
                <p class="action">
                    <button class="submit" id="subaddr">确认</button>
                </p>
            </div>
			</form> 
			
        </div>
    </div>
	<div id="show"></div>
<script>
	var areacondlimit ={$is_js_arealimit};
	
	<!--{if !empty($city['czone'])}-->
	var arealimitprovince = '{$city[czone]}';
	var arealimitcity = '{$cityname}';
	<!--{else}-->
	var arealimitprovince = '{$cityname}';
	var arealimitcity = '';
	<!--{/if}-->
	
	window.onload = function(){
		//addressInit('s_province', 's_city', 's_county', '陕西', '宝鸡市', '金台区');
		<!--{if $address_info}-->
		addressInit('s_province', 's_city', 's_county', '{$address_info[province]}', '{$address_info[city]}', '{$address_info[area]}');
		<!--{else}-->
		addressInit('s_province', 's_city', 's_county');
		<!--{/if}-->
						
	}
	$(function(){
		$('#subaddr').click(function(){
			
			var name = $.trim($('#name').val());
			var mobile = $.trim($('#mobile').val());
			var adinfo = $.trim($('#adinfo').val());
			var  s_county = $.trim($('#s_county').val());
			if(name == '')
			{
				alert('姓名不能为空');
				return false;
			}	
			if(mobile == '')
			{
				alert('手机号不能为空');
				return false;
			}
			if(!mobile.match('^1[3|5|8|7][0-9]{9}$')){ alert("请输入正确的手机号码！");return false; }
			
			if(s_county == '市辖区')
			{
				alert('请选择具体的区县');
				return false;
			}
			
			if(adinfo == '')
			{
				alert('详细地址不能为空');
				return false;
			}
			
			
		})
	})
</script>